package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.SysAssessment;
import com.ruoyi.system.mapper.SysAssessmentMapper;
import com.ruoyi.system.service.ISysAssessmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysAssessmentServiceImpl implements ISysAssessmentService {

    @Autowired
    private SysAssessmentMapper sysAssessmentMapper;

    @Override
    public SysAssessment templateIsExist() {
        return sysAssessmentMapper.selectTemplate();
    }

    @Override
    public void deleteTemplate() {
        sysAssessmentMapper.deleteTemplate();
    }

    @Override
    public void insert(SysAssessment assessment) {
        sysAssessmentMapper.insertSelective(assessment);
    }

    @Override
    public SysAssessment getTemplate() {
        return sysAssessmentMapper.selectTemplate();
    }

    @Override
    public SysAssessment selectAssessmentByUserId(Long userId) {
        return sysAssessmentMapper.selectByUserId(userId);
    }

    @Override
    public void deleteAssessmentByUserId(Long userId) {
        sysAssessmentMapper.deleteByUserId(userId);
    }

}
